<!-- 点会前 -->
<template>
  <img v-if="isTitle" src="@/assets/xinshuoImages/line.png" alt="" style="width: 100%" />
  <div ref="SetProtectRef" class="box">
    <div class="seq">
      <div class="line1"></div>
      <div class="txt">设置防护</div>
      <div class="line2"></div>
    </div>
    <div class="center">
      <div class="leftBox">
        <TitleAndLogo
          title="驻站联络员校验无误"
          img-url1="AI.png"
          style="width: 226px; font-size: 16px; margin-bottom: 10px"
        />
        <div class="videoBox">
          <video src="http://10.1.6.42:81/film/setProtect1.mp4" class="video" muted autoplay controls loop></video>
          <!-- 定位状态 -->
          <div class="fixStatus">
            <div v-for="item in statusArr.status1" :key="item" class="oneStatus">
              <TitleAndstatus :title="item" />
            </div>
          </div>
        </div>
      </div>
      <div class="rightBox">
        <TitleAndLogo
          title="劳动防护用品穿戴正确、齐全、有效"
          img-url1="AI.png"
          style="width: 339px; font-size: 16px; margin-bottom: 10px"
        />
        <div v-if="isGanggui" class="videoBox">
          <video src="http://10.1.6.42:81/film/setProtect2.mp4" class="video" muted autoplay controls loop></video>
          <!-- 定位状态 -->
          <div class="fixStatus">
            <div v-for="item in statusArr.status2" :key="item" class="oneStatus">
              <TitleAndstatus :title="item" />
            </div>
          </div>
        </div>
        <div v-else>
          <!-- 登高的轮播 -->
          <el-carousel :interval="5000" arrow="always" indicator-position="none" height="404px">
            <el-carousel-item>
              <div class="images">
                <div v-for="(item, index) in imgPeoples.SetProtectBanner1" :key="index" class="imgBox">
                  <img :src="urls.getAssetsFile(`${item.imgUrl}`)" alt="" />
                  <div class="oneStatus" style="display: flex; justify-content: center; margin: 14px 0">
                    <TitleAndstatus :title="item.status" />
                  </div>
                </div>
              </div>
            </el-carousel-item>
            <el-carousel-item>
              <div class="images">
                <div v-for="(item, index) in imgPeoples.SetProtectBanner2" :key="index" class="imgBox">
                  <img :src="urls.getAssetsFile(`${item.imgUrl}`)" alt="" />
                  <div class="oneStatus" style="display: flex; justify-content: center; margin: 14px 0">
                    <TitleAndstatus :title="item.status" />
                  </div>
                </div>
              </div>
            </el-carousel-item>
          </el-carousel>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { nextTick, reactive, ref } from 'vue'
import urls from '@/utils/url'
let SetProtectRef = ref()
let props = defineProps({
  isTitle: {
    type: Boolean,
    default: true,
  },
  isGanggui: {
    type: Boolean,
    default: true,
  },
  imgPeoples: {
    type: Object,
    default: () => {},
  },
})
let statusArr = reactive({
  status1: ['人员正确', '到岗正确', '证件正确'],
  status2: ['帽子', '到岗防护马甲正确', '防砸鞋'],
})

defineExpose({
  SetProtectRef,
})
</script>

<style lang="scss" scoped>
@import '@/styles/centerStyle.scss';
.box {
  display: flex;
  margin-top: 20px;
  // height: 600px !important;

  .seq {
    height: 522px;
  }

  .center {
    display: flex;
    width: calc(100% - 118px);
    .leftBox {
      width: 50%;
      margin-right: 50px;
    }
    .rightBox {
      width: 50%;
    }
    .videoBox {
      width: 100%;
      position: relative;
      height: 404px;

      .video {
        object-fit: cover;
        width: 100%;
        height: 404px;
      }
    }
    .fixStatus {
      display: flex;
      align-items: center;
      position: absolute;
      top: 6px;
      right: 6px;
      .oneStatus {
        margin-right: 16px;
        &:last-child {
          margin-right: 0;
        }
      }
    }
  }
  $imagesWidth: calc(675 / 723) * 100%;
  .images {
    display: flex;
    width: $imagesWidth;
    margin: auto;
    text-align: center;
    height: 100%;
    justify-content: space-between;
    .imgBox {
      width: 30%;
      background: #f5f9ff;
      box-shadow: 0px 2px 14px 0px rgba(0, 50, 135, 0.2);
      border-radius: 0px 0px 0px 0px;
      opacity: 1;
      border: 1px solid;
      border-image: linear-gradient(
          180deg,
          rgba(255, 255, 255, 1),
          rgba(179.40266132354736, 209.48730379343033, 255, 1)
        )
        1 1;
      &:first-child {
        margin-left: 12px;
      }
      &:last-child {
        margin-right: 12px;
      }
      > img {
        width: 94.6%;
      }
      .name {
        margin: 8px 0;
        text-align: center;
      }
    }
  }
}
</style>
